<!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
</head>
<body>
    <input type='checkbox' id="a" />
    <input type='checkbox' id="b" checked />
<script>
    alert(document.getElementById('a').getAttribute('checked'));
    alert(document.getElementById('b').getAttribute('checked'));
</script>
</body>
</html>